package www.sofn.com.address.domain.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;
import www.sofn.com.validate.group.InsertGroup;
import www.sofn.com.validate.group.UpdateGroup;

@Data
@ToString
@Accessors(chain = true)
@Schema(description = "地址")
public class AddressVO {
    @Schema(description = "id")
    @NotBlank(message = "id不能为空",groups = {UpdateGroup.class})
    private String id;
    @Schema(description = "收件人")
    @NotBlank(message = "收件人不能为空",groups = {UpdateGroup.class, InsertGroup.class})
    @Length(max = 20,message = "收件人不能大于{max}个字符" ,groups = {UpdateGroup.class, InsertGroup.class})
    private String recipient;//收件人
    @Schema(description = "电话")
    @NotBlank(message = "联系电话不能为空" ,groups = {UpdateGroup.class, InsertGroup.class})
    @Length(max = 15,message = "联系电话不能大于{max}个字符" ,groups = {UpdateGroup.class, InsertGroup.class})
    private String phone;//电话
    @Schema(description = "省份Id")
    private Integer provinceId;
    @Schema(description = "省份")
    @NotBlank(message = "省份不能为空" ,groups = {UpdateGroup.class, InsertGroup.class})
    @Length(max = 15,message = "省份不能大于{max}个字符" ,groups = {UpdateGroup.class, InsertGroup.class})
    private String provinceName;//省份
    @Schema(description = "城市Id")
    private Integer cityId;
    @Schema(description = "城市")
    @NotBlank(message = "城市不能为空",groups = {UpdateGroup.class, InsertGroup.class})
    @Length(max = 15,message = "城市不能大于{max}个字符",groups = {UpdateGroup.class, InsertGroup.class})
    private String cityName; //城市
    @Schema(description = "区域Id")
    private Integer countyId;
    @Schema(description = "区域")
    @NotBlank(message = "区不能为空",groups = {UpdateGroup.class, InsertGroup.class})
    @Length(max = 15,message = "区不能大于{max}个字符",groups = {UpdateGroup.class, InsertGroup.class})
    private String countyName;//区域
    @Schema(description = "地址")
    @NotBlank(message = "区不能为空",groups = {UpdateGroup.class, InsertGroup.class})
    @Length(min = 3,max = 50,message = "区不能大于{max}个字符",groups = {UpdateGroup.class, InsertGroup.class})
    private String streetName;//地址
    @Schema(description = "默认状态")
    private Boolean defaultStatus;
}
